﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Wolfy.NetDisk.Site.Models
{
    /// <summary>
    /// 用来在视图展示的User
    /// </summary>
    public class UserViewModel
    {
        /// <summary>
        /// 姓名
        /// </summary>
        [MaxLength(128, ErrorMessage = "很抱歉，用户名不能超过32个字符")]
        [Required(ErrorMessage = "请填写您的用户名")]
        [Display(Name = "用户名")]
        public string UserName { set; get; }
        /// <summary>
        /// 密码
        /// </summary>
        [StringLength(32, ErrorMessage = "很抱歉，密码长度6~32位", MinimumLength = 6)]
        [MaxLength(32, ErrorMessage = "很抱歉，密码长度6~32位")]
        [Required(ErrorMessage = "请填写密码")]
        [Display(Name = "密码")]
        public string Pwd { set; get; }
        [StringLength(32, ErrorMessage = "很抱歉，密码长度6~32位", MinimumLength = 6)]
        [MaxLength(32, ErrorMessage = "很抱歉，密码长度6~32位")]
        [Required(ErrorMessage = "两次密码输入不一样")]
        [System.ComponentModel.DataAnnotations.Compare("Pwd", ErrorMessage = "两次密码输入不一致")]
        [Display(Name = "确认密码")]
        public string SurePwd { set; get; }
        /// <summary>
        /// 性别
        /// </summary>
        [Display(Name = "性别")]
        public string Gender { set; get; }

        /// <summary>
        /// 所属部门（一个用户属于一个部门）
        /// </summary>
        [Display(Name = "部门")]
        public string Department { set; get; }
        /// <summary>
        /// 验证码
        /// </summary>
        [Required(ErrorMessage = "验证码不能为空")]
        public string VerifyCode { set; get; }
    }
}